package com.study.spring.thread;

import java.util.concurrent.CountDownLatch;

/**
 * @author zhang
 * @date 2019/03/22
 */
public class Processor implements Runnable {


    private final CountDownLatch countDownLatch;

    public Processor(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        try {
            System.out.println(Thread.currentThread().getName() + "执行完毕！");
            Thread.sleep(60 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        countDownLatch.countDown();
    }

}
